package com.linxz.wandnroid.adapter;

import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.linxz.wandnroid.R;
import com.linxz.wandnroid.pojo.resp.WanAndroidNavigationListResp;
import com.linxz.wandnroid.widget.LayoutDivider;

/**
 * @author Linxz
 * 创建日期：2020年02月27日 15:33
 * version：v4.5.4
 * 描述：
 */
public class SystemNavigationAdapter extends BaseQuickAdapter<WanAndroidNavigationListResp.DataBean, BaseViewHolder> {

    public SystemNavigationAdapter() {
        super(R.layout.wandroid_item_navigation);
    }

    @Override
    protected void convert(BaseViewHolder helper, WanAndroidNavigationListResp.DataBean item) {
        LayoutDivider layoutDivider=helper.getView(R.id.layoutDivider);
        RecyclerView rvNavigationItems=helper.getView(R.id.rvNavigationItems);
        layoutDivider.setTittleName(item.getName());

        rvNavigationItems.setLayoutManager(new GridLayoutManager(mContext,4));
        SystemNavigationItemsAdapter adapter=new SystemNavigationItemsAdapter(item.getArticles());
        rvNavigationItems.setAdapter(adapter);
    }
}
